package com.ruoyi.policy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.policy.mapper.XlkjPolicyMapper;
import com.ruoyi.policy.domain.XlkjPolicy;
import com.ruoyi.policy.service.IXlkjPolicyService;

/**
 * 政策服务Service业务层处理
 * 
 * @author wang
 * @date 2022-01-13
 */
@Service
public class XlkjPolicyServiceImpl implements IXlkjPolicyService 
{
    @Autowired
    private XlkjPolicyMapper xlkjPolicyMapper;

    /**
     * 查询政策服务
     * 
     * @param id 政策服务主键
     * @return 政策服务
     */
    @Override
    public XlkjPolicy selectXlkjPolicyById(Long id)
    {
        return xlkjPolicyMapper.selectXlkjPolicyById(id);
    }

    /**
     * 查询政策服务列表
     * 
     * @param xlkjPolicy 政策服务
     * @return 政策服务
     */
    @Override
    public List<XlkjPolicy> selectXlkjPolicyList(XlkjPolicy xlkjPolicy)
    {
        return xlkjPolicyMapper.selectXlkjPolicyList(xlkjPolicy);
    }

    /**
     * 新增政策服务
     * 
     * @param xlkjPolicy 政策服务
     * @return 结果
     */
    @Override
    public int insertXlkjPolicy(XlkjPolicy xlkjPolicy)
    {
        xlkjPolicy.setCreateTime(DateUtils.getNowDate());
        return xlkjPolicyMapper.insertXlkjPolicy(xlkjPolicy);
    }

    /**
     * 修改政策服务
     * 
     * @param xlkjPolicy 政策服务
     * @return 结果
     */
    @Override
    public int updateXlkjPolicy(XlkjPolicy xlkjPolicy)
    {
        xlkjPolicy.setUpdateTime(DateUtils.getNowDate());
        return xlkjPolicyMapper.updateXlkjPolicy(xlkjPolicy);
    }

    /**
     * 批量删除政策服务
     * 
     * @param ids 需要删除的政策服务主键
     * @return 结果
     */
    @Override
    public int deleteXlkjPolicyByIds(Long[] ids)
    {
        return xlkjPolicyMapper.deleteXlkjPolicyByIds(ids);
    }

    /**
     * 删除政策服务信息
     * 
     * @param id 政策服务主键
     * @return 结果
     */
    @Override
    public int deleteXlkjPolicyById(Long id)
    {
        return xlkjPolicyMapper.deleteXlkjPolicyById(id);
    }
}
